import { fileURLToPath, URL } from 'node:url'
import path from "path"
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import globalStyle from '@originjs/vite-plugin-global-style'


// https://vitejs.dev/config/
export default defineConfig({
    plugins: [
        vue(),
        globalStyle({
            sourcePath: './src/assets',
            lessEnabled: true
        })
    ],
    // server: {
    //     proxy: {
    //         '/api': {
    //             target: 'http://192.168.3.15',
    //             rewrite:(path) => path.replace(/^api/,'')
    //         }
    //     }
    // },
    resolve: {
        alias: {
            '@': fileURLToPath(new URL('./src', import.meta.url))
        }
    },
    css: {
        preprocessorOptions: {
            less: {
                additionalData: '@import "@/assets/flex.less";'
            },
        },
    },
})
